<?php

namespace app\admin\model;

use think\Model;

class CarOrder extends Model
{
    public function station()
    {
        return $this->belongsTo(Station::class);
    }

    public function joinUser()
    {
        return $this->belongsTo(User::class, 'user_id');
    }

    public function outUser()
    {
        return $this->belongsTo(User::class, 'pay_user_id');
    }

    public function getPayStatusAttr($value,$data)
    {
        $status = [ 1 =>'是', 0 => '否'];
        return $status[$data['is_pay']] ?? '';
    }
}
